/////////
//Namen: obstaja veliko stvari, ki jih ne moremo uporabit na client strani zato s to datoteko to naredimo na server strani.
/////////

function Stream_GiveMoney( ply, handler, id, encoded, decoded )
	local receiver_ply = player.GetByID(decoded[1])
	receiver_ply:GiveMoney(decoded[2])
end

datastream.Hook( "GIVE_MONEY", Stream_GiveMoney )

function Stream_TakeMoney( ply, handler, id, encoded, decoded )
	local receiver_ply = player.GetByID(decoded[1])
	receiver_ply:TakeMoney(decoded[2])
end

datastream.Hook( "TAKE_MONEY", Stream_TakeMoney )

function Stream_CreateJobNpc( ply, handler, id, encoded, decoded )
	local ent = ents.Create("npc_salesman")
	ent:SetPos(ply:GetEyeTrace().HitPos)
	ent:SetNetworkedVar("npc_modelname", decoded[1])
	ent:SetNetworkedVar("npc_job_type", decoded[2])
	ent:SetNetworkedVar("npc_umsg_message", decoded[3])
	ent:Spawn()
end

datastream.Hook( "CREATE_JOB_NPC", Stream_CreateJobNpc )